package com.gf.demo.debugdemo.service.impl;

import com.gf.demo.debugdemo.model.TestClass;
import com.gf.demo.debugdemo.service.ITestService;
import com.gf.demo.debugdemo.service.check.ITestClassCheck;
import com.gf.framework.common.utils.SpringContextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.function.Consumer;

/**
 * @author gaofei
 * @date 2022/6/19 11:12
 */
@Component
@Slf4j
public class TestServiceImpl1 implements ITestService {
    @Resource
    private List<ITestClassCheck> classCheckList;

    @Override
    public void test() {
        log.info("TestServiceImpl1");
    }

    @Override
    public Boolean save(TestClass testClass) {
        // todo 保存的逻辑
        classCheckList.forEach(iTestClassCheck -> iTestClassCheck.saveCheck(testClass));


        return true;
    }
}
